<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Person(name,age,gender){
        this.name=name
        this.age=age
        this.gender=gender
    }
    Person.prototype.s1=function(){
        console.log('1');
    }
    function Student(name,age,gender,num){
        Person.call(this,name,age,gender)
        this.num=num
        console.log('我叫'+this.name,'年龄是'+this.age,'性别是'+this.gender,'学号是'+this.num);
    }
    Student.prototype=new Person()
    Student.prototype.constructor=Student
    console.log(Student.prototype);
    
    Student.prototype.s1=function(){
        console.log('2');
    }
   
  
    let n=new Student('张博',18,'男',666)
    // console.log(n);
    
    // n.s1()
    // n.s2()
</script>
</html>